package com.franklin.ideaplugin.maphelper.col.method.impl;

import com.franklin.ideaplugin.maphelper.col.method.IColQueryMethod;

/**
 * @author Ye Junhui
 * @since 2024/3/22
 */
public class PrefixMatchColQueryMethod implements IColQueryMethod {

    private final String prefix;

    public PrefixMatchColQueryMethod(String prefix) {
        this.prefix = prefix;
    }


    @Override
    public String getMethodName() {
        return this.prefix;
    }

    @Override
    public int getQueryTargetIndex() {
        return 0;
    }

    @Override
    public boolean match(String methodName) {
        return methodName.startsWith(this.prefix);
    }
}
